// $Id: client.h 16 2011-04-11 18:56:33Z cedric.shih@gmail.com $
/*
 * Copyright (C) 2011 Cedric Shih <cedric.shih@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef NIOHTTP_CLIENT_H_
#define NIOHTTP_CLIENT_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <nio/handler.h>

struct niohttp_client_codec *niohttp_client_codec_new(void);

void niohttp_client_codec_free(void *obj);

int niohttp_request_encode(void *obj, struct niohandler_event *event);

int niohttp_response_decode(void *obj, struct niohandler_event *event);

struct niohandler niohttp_client_handler = {
		niohttp_request_encode,
		niohttp_response_decode,
		niohttp_client_codec_free,
};

#ifdef __cplusplus
}
#endif

#endif /* NIOHTTP_CLIENT_H_ */
